<include file="public/layout" />
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>住户管理 - 添加住户</h3>
                <h5>网站系统添加住户</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" method="post" id="add_form" enctype="multipart/form-data">
        <div class="ncap-form-default">
            <input type="hidden" name="id" id="id" class="input-txt" value="{$list.id}">
            <dl class="row">
                <dt class="tit">
                    <label for="rname"><em>*</em>住户姓名</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="rname" id="rname" class="input-txt" value="{$list.rname}">
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="phone"><em>*</em>手机号</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="phone" id="phone" class="input-txt" value="{$list.phone}">
                    <span class="err"></span>
                    <p class="notic">请输入11位手机号码</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="email"><em>*</em>邮箱</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="email" id="email" class="input-txt" value="{$list.email}">
                    <span class="err"></span>
                    <p class="notic">请输入您的邮箱</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="card"><em>*</em>身份证号</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="card" id="card" class="input-txt" value="{$list.card}">
                    <span class="err"></span>
                    <p class="notic">请输入居民身份证号</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="sex">性别</label>
                </dt>
                <dd class="opt">
                    <input name="sex" type="radio" <if condition="$list['sex'] eq 1">checked</if> value="1">男  &nbsp;&nbsp;&nbsp;&nbsp;
                    <input name="sex" type="radio" <if condition="$list['sex'] eq 2">checked</if> value="2">女
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" onclick="checkUserUpdate();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function checkUserUpdate(){
        var email = $('input[name="email"]').val();
        var phone = $('input[name="phone"]').val();
        var password = $('input[name="password"]').val();
        var rname = $.trim($('input[name="rname"]').val());
        var card = $.trim($('input[name="card"]').val());
        var error ='';
        if(rname == ''){
            error += "姓名不能为空\n";
        }
         if(card == ''){
            error += "身份证号不能为空不能为空\n";
        }
        if(!checkEmail(email) && email != ''){
            error += "邮箱地址有误\n";
        }
        if(!checkMobile(phone) && mobile != ''){
            error += "手机号码填写有误\n";
        }
        if(error){
            layer.alert(error, {icon: 2});  //alert(error);
            return false;
        }
        $('#add_form').submit();
    }
</script>
</body>
</html>